<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePickingOrderDetailTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('picking_detail', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('picking_id')->comment('下架单');
            $table->unsignedBigInteger('order_id')->comment('订单');
            $table->unsignedBigInteger('batch_inventory_id')->comment('产品批次号');
            $table->unsignedInteger('product_id')->comment('产品');
            $table->string('barcode', 60)->comment('产品条码');
            $table->unsignedInteger('quantity')->comment('数量');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('picking_detail');
    }
}
